<?php $this->_extends('_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>

<span><a href="<?php echo url('user/ImportFromExcel'); ?>">从excel导入</a>&nbsp;&nbsp; <a href="<?php echo url('user/AddMember'); ?>">企业用户添加</a> </span>
<div class="notification error png_bg">
导入预览，新增的用户密码和用户名一致，请尽快通过客户端修改密码    </div>

<form action="<?php echo url('user/previewbatchimport'); ?>" method="post" name="mainform" enctype="multipart/form-data">

<span>下列用户将增加到数据库中：</span>
<table width="100%">
<thead>
    <th width="10%">用户名</th>
    <span><th width="10%">显示姓名</th></span>
    <span><th width="5%">排序</th></span>
    <span><th width="10%">家庭电话</th></span>
    <span><th width="10%">移动电话</th></span>
    <span><th width="10%">公司电话</th></span>
    <span><th width="10%">部门</th></span>
    <span><th width="10%">职位</th></span>
    <span><th width="*">IMSI</th></span>
</thead>
<tbody>
<?php $count=0; ?>
<?php foreach($good_users as $guser): ?>
<tr>
    <span><td width="10%"><?php echo $guser->username; ?></td></span>
    <span><td width="10%"><?php echo $guser->user_realname; ?></td></span>
    <span><td width="5%"><?php echo $guser->user_position; ?></td></span>
    <span><td width="10%"><?php echo $guser->user_hometel; ?></td></span>
    <span><td width="10%"><?php echo $guser->user_cellphone; ?></td></span>
    <span><td width="10%"><?php echo $guser->user_officetel; ?></td></span>
    <?php if(strlen($user_dep[$count])> 0): ?>
        <span><td width="10&"><?php echo $user_dep[$count]; $count++; ?></td></span>
    <?php else: ?>
        <span><td width="10&">默认部门</td></span>
    <?php endif; ?>
    <span><td width="10%"><?php echo $guser->reserved_1; ?></td></span>
    <span><td width="*"><?php echo $guser->user_email; ?></td></span>
</tr>
<?php endforeach; ?>
</tbody>
</table>

<?php if($duplicate_users): ?>
<span>下列用户名已经存在:</span>
<table width="100%">
<thead>
     <th width="10%">用户名</th> 
    <span><th width="10%">显示姓名</th></span>
    <span><th width="10%">排序号码</th></span>
    <span><th width="10%">家庭电话</th></span>
    <span><th width="10%">移动电话</th></span>
    <span><th width="10%">公司电话</th></span>
</thead>
<?php foreach($duplicate_users as $duser): ?>
<tr>
    <span><td width="10%"><?php echo $duser->username; ?></td></span>
    <span><td width="10%"><?php echo $duser->user_realname; ?></td></span>
    <span><td width="10%"><?php echo $duser->user_position; ?></td></span>
    <span><td width="10%"><?php echo $duser->user_hometel; ?></td></span>
    <span><td width="10%"><?php echo $duser->user_cellphone; ?></td></span>
    <span><td width="10%"><?php echo $duser->user_officetel; ?></td></span>
</tr>
<?php endforeach; ?>
</table>
<?php  endif; ?>

<?php if($bad_users): ?>
<h3>下列用户名为空:</h3>
<table width="100%">
<thead>
    <span><th width="10%">用户名</th></span>
    <span><th width="10%">显示姓名</th></span>
    <span><th width="10%">排序号码</th></span>
    <span><th width="10%">家庭电话</th></span>
    <span><th width="10%">移动电话</th></span>
    <span><th width="10%">公司电话</th></span>
    <span><th width="10%">电子邮件</th></span>
</thead>
<?php foreach($bad_users as $user): ?>
<tr>
    <span><td width="10%"><?php echo $user->username; ?></td></span>
    <span><td width="10%"><?php echo $user->user_realname; ?></td></span>
    <span><td width="10%"><?php echo $user->user_position; ?></td></span>
    <span><td width="10%"><?php echo $user->user_hometel; ?></td></span>
    <span><td width="10%"><?php echo $user->user_cellphone; ?></td></span>
    <span><td width="10%"><?php echo $user->user_officetel; ?></td></span>
    <span><td width="10%"><?php echo $user->user_email; ?></td></span>
</tr>
<?php endforeach; ?>
</table>
<? endif; ?>
<input type="hidden" name="upload_excel_file" value="<?php echo $upload_excel_file ?>" id="upload_excel_file" />
<input type="submit" name="提交" id="submit" />

</form>
<?php $this->_endblock(); ?>
